/*
 * sfstest.h
 *
 *  Created on: Mar 21, 2010
 *      Author: fire
 */

#ifndef SFSTEST_H_
#define SFSTEST_H_


extern int
sfs_open(char *pathname);

extern int
sfs_read(int fd,
	 int start,
	 int length,
	 char *mem_pointer);

extern int
sfs_write(int fd,
	  int start,
	  int length,
	  char *mem_pointer);

extern int
sfs_readdir(int fd,
	    char *mem_pointer);

extern int
sfs_close(int fd);

extern int
sfs_delete(char *pathname);

extern int
sfs_create(char *pathname,
	   int type);

extern int
sfs_getsize(char *pathname);

extern int
sfs_gettype(char *pathname);

extern int
sfs_initialize(int erase);


typedef struct {
    char super_block_0[128];
    char super_block_1[128];
}super_blcok;

typedef struct {
    char type;              //1
    char name_list[14][7];
    short int dest_list[14];
    char valid;             //1
}floder_blcok;

typedef struct {
    char type;              //1     1--> Directory; 0-->File
    short int file_size;
    char content[120];      //122
    char valid;             //1
    int  next_block_num;    //4
}data_blcok;                //This can either be a file or a directory

typedef struct {
    char block_content[128];
    char type;
    int block_index;
    int file_ptr;
    char valid;
}i_blcok;

typedef struct {
    floder_blcok block_content;
    char block_index;
    int folder_ptr;
    char valid;
}i_floder_blcok;

#endif /* SFSTEST_H_ */
